Optimal. Leaf size=49 \[ -\frac{2 i a^4}{d (a-i a \tan (c+d x))}+\frac{i a^3 \log (\cos (c+d x))}{d}-a^3 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0486997, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3487, 43} \[ -\frac{2 i a^4}{d (a-i a \tan (c+d x))}+\frac{i a^3 \log (\cos (c+d x))}{d}-a^3 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3487
Rule 43
Rubi steps
\begin{align*} \int \cos ^2(c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \frac{a+x}{(a-x)^2} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \left (\frac{2 a}{(a-x)^2}+\frac{1}{-a+x}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-a^3 x+\frac{i a^3 \log (\cos (c+d x))}{d}-\frac{2 i a^4}{d (a-i a \tan (c+d x))}\\ \end{align*}
Mathematica [B] time = 0.277116, size = 99, normalized size = 2.02 \[ -\frac{a^3 (\cos (c+4 d x)+i \sin (c+4 d x)) \left (\cos (c+d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x+2 i\right )+\sin (c+d x) \left (-\log \left (\cos ^2(c+d x)\right )-2 i d x-2\right )\right )}{2 d (\cos (d x)+i \sin (d x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.051, size = 87, normalized size = 1.8 \begin{align*}{\frac{{\frac{i}{2}}{a}^{3} \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{i{a}^{3}\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+2\,{\frac{{a}^{3}\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{d}}-{a}^{3}x-{\frac{{a}^{3}c}{d}}-{\frac{{\frac{3\,i}{2}}{a}^{3} \left ( \cos \left ( dx+c \right ) \right ) ^{2}}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.69114, size = 84, normalized size = 1.71 \begin{align*} -\frac{2 \,{\left (d x + c\right )} a^{3} + i \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac{4 \,{\left (a^{3} \tan \left (d x + c\right ) - i \, a^{3}\right )}}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.18139, size = 93, normalized size = 1.9 \begin{align*} \frac{-i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.709498, size = 53, normalized size = 1.08 \begin{align*} 2 a^{3} \left (\begin{cases} - \frac{i e^{2 i d x}}{2 d} & \text{for}\: d \neq 0 \\x & \text{otherwise} \end{cases}\right ) e^{2 i c} + \frac{i a^{3} \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.25177, size = 49, normalized size = 1. \begin{align*} \frac{-i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]